Add some verbose log output when xattr functions fail
authorStef Walter <stefw@redhat.com>
Tue, 13 Aug 2013 13:42:06 +0000 (15:42 +0200)
committerStef Walter <stefw@redhat.com>
Wed, 14 Aug 2013 05:50:49 +0000 (07:50 +0200)
If any of the system xattr functions fail, clearly write out the
reason in the verbose log output.

https://bugzilla.gnome.org/show_bug.cgi?id=705893

src/libostree/ostree-core.c

index b8f3988454765b4513fd943ecbb93bf4e4437e84..8dc2b9606219be3eaf9a7fe9dfcb30d1071cde06 100644 (file)
@@ -187,6 +187,7 @@ read_xattr_name_array (const char *path,
       if (bytes_read < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lgetxattr (%s, %s) failed: ", path, p);
           goto out;
         }
       if (bytes_read == 0)
@@ -196,6 +197,7 @@ read_xattr_name_array (const char *path,
       if (lgetxattr (path, p, buf, bytes_read) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lgetxattr (%s, %s) failed: ", path, p);
           g_free (buf);
           goto out;
         }
@@ -240,6 +242,7 @@ ostree_get_xattrs_for_file (GFile         *f,
       if (errno != ENOTSUP)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "llistxattr (%s) failed: ", path);
           goto out;
         }
     }
@@ -249,6 +252,7 @@ ostree_get_xattrs_for_file (GFile         *f,
       if (llistxattr (path, xattr_names, bytes_read) < 0)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "llistxattr (%s) failed: ", path);
           goto out;
         }
       xattr_names_canonical = canonicalize_xattrs (xattr_names, bytes_read);
@@ -865,6 +869,7 @@ ostree_set_xattrs (GFile  *f,
       if (loop_err)
         {
           ot_util_set_error_from_errno (error, errno);
+          g_prefix_error (error, "lsetxattr (%s, %s) failed: ", path, name);
           goto out;
         }
     }